package 回溯法;
import java.util.Arrays;

public class 回溯法_子集树 {
    public static void dfs(int[] array,int dep) {
        int size=array.length;
        if(dep==size) {
            print(array);
        }
        else
        {
            for(int i=0;i<2;i++) {
                array[dep]=i;
                dfs(array,dep+1);//增加约束条件Constraint(t)和判断边界条件Bound(t)

            }
        }
    }
    private static void print(int[] array) {
        // TODO Auto-generated method stub
        System.out.println(Arrays.toString(array));

    }
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        int[] array= {1,2,3,4};
        dfs(array,0);
    }

}
